<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" value="hello" id="inputId"><br>
    <input type="button" value="点我" onclick="clickMe()">
<script>
    function clickMe(){
        // console.log("clickMe");
        var array = document.getElementsByTagName("input");
        console.log(array[0].value);
        // var inputOj = document.getElementById("inputId");
        // console.log(inputOj.value);
    }
</script>
</body>
</html>